UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KvChgjzvjCpNU1CydxHMn4ANi82BpEpIy6h4eFJIpCM=' 
WHERE 
  key_id = 'cdd6097b7248847859d52e4e8e23157e3212462ba15a9e7622031cfbdca015ec' 
  AND (
    token = 'KvChgjzvjCpNU1CydxHMn4ANi82BpEpIy6h4eFJIpCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042