UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZbkMXVdJ8ccikoa1rxR+OEcC5Ub0NAMPnGv5zrNAFnA=' 
WHERE 
  key_id = '4e6667f0fb04634c3d3c79ce1b2e25538e7dd5715e70be6bda260c737521d040' 
  AND (
    token = 'ZbkMXVdJ8ccikoa1rxR+OEcC5Ub0NAMPnGv5zrNAFnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015