UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fYtWC0qnW+RNk2VatGsfO/lfF1Z4qQby97B7CkDsqCI=' 
WHERE 
  key_id = '1170ec6546d861297b4121d6e809ae1eb695dd0d8a235b6734bf4d6d6cf0e984' 
  AND (
    token = 'fYtWC0qnW+RNk2VatGsfO/lfF1Z4qQby97B7CkDsqCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035