UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E7BViY54FeBhCtL7l6JGvmdj3r9YV+JvcWYJD/mIHFA=' 
WHERE 
  key_id = 'c085afe83bae3af25cd853d90578e3c7e37286809ec5206ba50bb202e3755d78' 
  AND (
    token = 'E7BViY54FeBhCtL7l6JGvmdj3r9YV+JvcWYJD/mIHFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027