UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7c7tJLFmBIWaiOzZZYg+s15lI+Dq5ytuPHAOOiheMpc=' 
WHERE 
  key_id = 'd6264f232a1b1e571b024ecc32afe480ac010b7c9d8f201aa9470dc727f99548' 
  AND (
    token = '7c7tJLFmBIWaiOzZZYg+s15lI+Dq5ytuPHAOOiheMpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033