UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IqwEz4Ihqmlc3GpXWGG+XwkBywxazzRlOLdStqPflNc='
WHERE
key_id = '399a3be2e333873f684bb85ea8bcd4b6fc7923ea03cffcabf1239c9b80b39dec'
AND (
token = 'IqwEz4Ihqmlc3GpXWGG+XwkBywxazzRlOLdStqPflNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)