UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/YH4BXzHKKyjAIBt1+7MADjKTQh9g5cgay2vTqGg4sU=' 
WHERE 
  key_id = '18f4452d1f03687749cc0e26a214b6f2880df2f5bd0385bdb83ca17813d168f8' 
  AND (
    token = '/YH4BXzHKKyjAIBt1+7MADjKTQh9g5cgay2vTqGg4sU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041