UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '171U7KiHMXmjD0+SSQSPlPzDZrPeMK8uG1nPznfsLzA=' 
WHERE 
  key_id = '7908dc96c987e7354240a5edf10c3df5c7200d80da5756acff4aa410d1a9b656' 
  AND (
    token = '171U7KiHMXmjD0+SSQSPlPzDZrPeMK8uG1nPznfsLzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017