UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y+nbDlh8+RFzX4j9elxSHBuh1eziXGD7sRcDGEt/JGo=' 
WHERE 
  key_id = '98017e386d1aa0cbb7e769bbfeddc3dae2343318493901d8187b1679a01c3a3d' 
  AND (
    token = 'Y+nbDlh8+RFzX4j9elxSHBuh1eziXGD7sRcDGEt/JGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035