UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'svB6bdw8Oboi9UM6ZHguTVelX6Oaqgz2V3ENxUL7QbI=' 
WHERE 
  key_id = '57cd1af53533aeaaff31c87f586414eb136b369468f935a0918aad70bdd7808e' 
  AND (
    token = 'svB6bdw8Oboi9UM6ZHguTVelX6Oaqgz2V3ENxUL7QbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030