UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EH4Bmng+fnc/6EfE9va8HzU++GW21lPlBMAU6DaHHXs=' 
WHERE 
  key_id = '9eeacc2f6405ad75bb37241de3834267e85ad38bd1c0328888a4ee2c5314dea8' 
  AND (
    token = 'EH4Bmng+fnc/6EfE9va8HzU++GW21lPlBMAU6DaHHXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025