UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ptNxQzr/mjfjJ5BEQZv+/RzzHAzBnOONlhN4js+Xe/M=' 
WHERE 
  key_id = '7356424e03e8c51485d426115eba31b4122ea1e003ae4f5974f032870fe3569f' 
  AND (
    token = 'ptNxQzr/mjfjJ5BEQZv+/RzzHAzBnOONlhN4js+Xe/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037