UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q0H0ANjx/5ZKE39FmK9iWGJSuXLqW5S89JJGbhNENeU='
WHERE
key_id = '3a24d6aa363d3686a276c6905ca8117ed1a4dfa93e66b305828069ec7207cad6'
AND (
token = 'q0H0ANjx/5ZKE39FmK9iWGJSuXLqW5S89JJGbhNENeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)