UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9hg8jX3ir/xH3l99WHA4arNJ6jNgVp9RuaeZxfIgQfU=' 
WHERE 
  key_id = '88972f297780e0a40f41ef1c2568d71434425230559fd5b4f64b94fa7b7be124' 
  AND (
    token = '9hg8jX3ir/xH3l99WHA4arNJ6jNgVp9RuaeZxfIgQfU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029