UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2rZ22l7Ss1eLJM63orgBRMgObzmCMD897UwwrWC8xDA=' 
WHERE 
  key_id = '4dcf91fb6085fc914a4817b797cb93d1e0ab5d2e0e6777e0aa78c6ec90a21ca0' 
  AND (
    token = '2rZ22l7Ss1eLJM63orgBRMgObzmCMD897UwwrWC8xDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025