UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kKf99yo/jJ65xvW4VEFKGdADiuUFFEHgWJWZTcwhq3I=' 
WHERE 
  key_id = '1e3b8fa9256ef2407f7d18aaf09b2ac888c96c2971285e9cd56fe3e2de927427' 
  AND (
    token = 'kKf99yo/jJ65xvW4VEFKGdADiuUFFEHgWJWZTcwhq3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041