UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IL4jA2Bg/YyFf6CPBbrghJ1shOOV9I+F+T/fi4/b7Zs=' 
WHERE 
  key_id = '88cf3f58c5cda19874ceb3eaa105353f1a05a50bef9785b327afe6a70519c516' 
  AND (
    token = 'IL4jA2Bg/YyFf6CPBbrghJ1shOOV9I+F+T/fi4/b7Zs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028