UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mvRRqgdWD7lvQDozL014ZefYCGPzoj5hvfHJ4MxFe4E=' 
WHERE 
  key_id = '9453615b1ae8eb3a9638ecb2c53779a27b94f30f8d14ddfc41abd577e6ecdb8b' 
  AND (
    token = 'mvRRqgdWD7lvQDozL014ZefYCGPzoj5hvfHJ4MxFe4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023