UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3KHLl6Eie5pGQoZRUwAEEBD/tL5tdZqWJ9urZhAGbag=' 
WHERE 
  key_id = '63a60c5eca09bb748d1031dddd85246634d172fbbcb40dd09bb931451b5b1c1b' 
  AND (
    token = '3KHLl6Eie5pGQoZRUwAEEBD/tL5tdZqWJ9urZhAGbag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032