UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9+wjFPo30WAmXxBH5R/TEXp6kiKf6wy0/MGz5Xr0l7s=' 
WHERE 
  key_id = '3690701a94c1ff88145e4d4e9e3e3601cc91ca408856eccc625e2110fa8a0b4e' 
  AND (
    token = '9+wjFPo30WAmXxBH5R/TEXp6kiKf6wy0/MGz5Xr0l7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040