UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm0yqUyEMhENh4t/Nc4nwvxZ0TtvPGNJNxbmheeGyr/A=' 
WHERE 
  key_id = 'd3b572dfc5e8f46bcc10ece03eec7669149bfc709624c5422499abc0267ecd61' 
  AND (
    token = 'm0yqUyEMhENh4t/Nc4nwvxZ0TtvPGNJNxbmheeGyr/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030