UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uxtbbOwBvnt3MCTmuMYMinGvv2fbpBMKl71eztNMOu4=' 
WHERE 
  key_id = 'cf7337c8f9819bbb04f30b8f070a3ba892c54a889f93521a7c0f78d0bae927c4' 
  AND (
    token = 'uxtbbOwBvnt3MCTmuMYMinGvv2fbpBMKl71eztNMOu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020