UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bQXXopCz95MNrquTTM1pKLSTd62q2m2VxElExEJVcTY=' 
WHERE 
  key_id = '7d7756f1720f0cb89914d3a91f13cf7dbaaa4baef4f3d0464fa4bb1545de66a8' 
  AND (
    token = 'bQXXopCz95MNrquTTM1pKLSTd62q2m2VxElExEJVcTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039