UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xnudUZWk1hyY0HEpbI41Ev+X4DFHuTvKnoxV04EcsNg=' 
WHERE 
  key_id = '664c1f84072da399866343ca115edf4a3258699928c8fbcc39a578b1f770281b' 
  AND (
    token = 'xnudUZWk1hyY0HEpbI41Ev+X4DFHuTvKnoxV04EcsNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036