UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YEthiIhebuGJEoGPPP9r1BtBITbxsK+5Su7OyDhp+6E=' 
WHERE 
  key_id = '04df2db73fcad9724f4dc8fe084e17a911213bf49d69d2ba14b9a0adae863320' 
  AND (
    token = 'YEthiIhebuGJEoGPPP9r1BtBITbxsK+5Su7OyDhp+6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039