UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l6pdf4yUzD5PeT3bOvsdgqzkBS6+RUwDMs5XCWnjc5M=' 
WHERE 
  key_id = '693c66e5285b52fbe18d19582f3ace76991d51d0129542ee56e06a3bf46acfb7' 
  AND (
    token = 'l6pdf4yUzD5PeT3bOvsdgqzkBS6+RUwDMs5XCWnjc5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030