UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FSaiPgs91hI0rq1w8Hh5Gr3ngqKsliJp5EO0cFUU9nw=' 
WHERE 
  key_id = '53f571f4db0af583ce4524523bd3e8888fa6f0f27b0b971cbbc6db66bc1a73a9' 
  AND (
    token = 'FSaiPgs91hI0rq1w8Hh5Gr3ngqKsliJp5EO0cFUU9nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023