UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Vu63uG3AV9DRW/0JBJ4q8sdL0rHfaY8dkQI+OL/uwM=' 
WHERE 
  key_id = 'afee5e37aea701a33ff7f530a6b0982446a74160db26a786f79adfa60b8cacfc' 
  AND (
    token = '9Vu63uG3AV9DRW/0JBJ4q8sdL0rHfaY8dkQI+OL/uwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033