UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cuGHfxPyYsllOQ5NO1R5Q9ezdEvTJLVY8ZC4dg2LUzE=' 
WHERE 
  key_id = '85fa520269a3fb06769f86a7baf9e638b13fe6eb4fd2a5ace662f37ff78c5de1' 
  AND (
    token = 'cuGHfxPyYsllOQ5NO1R5Q9ezdEvTJLVY8ZC4dg2LUzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043