UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BusuXHX1yneJ7Ohk8lD7I2cemi57KXj0kRXNltO+MR4=' 
WHERE 
  key_id = '8327b9a33a618e8fadb48da7abc765c4a8ef9f5ab07e8c67e16cebd0e2af8061' 
  AND (
    token = 'BusuXHX1yneJ7Ohk8lD7I2cemi57KXj0kRXNltO+MR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023