UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YKpqMsGvjZu11fPZLHvCjixBjqi9+Kp0m0bicr67GzE=' 
WHERE 
  key_id = 'd6a695340f26d1b1a8b79c0ea435d9efe77ed9279fdddee88797a73426e0fbf6' 
  AND (
    token = 'YKpqMsGvjZu11fPZLHvCjixBjqi9+Kp0m0bicr67GzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034