UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ejDAYKaECFabGry7R/JJeslcmJYLKgT+5711UbP/Yo=' 
WHERE 
  key_id = 'ba65632d1db4ea22f9972b1e4520a905c7bca4c9ccfa0d5a039758349f5c2559' 
  AND (
    token = '/ejDAYKaECFabGry7R/JJeslcmJYLKgT+5711UbP/Yo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023