UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ksrB+sJGSAR/vpYYnAXYc5JKvsr+9nIMFu0kwl30gbI='
WHERE
key_id = 'e95a7bc829a7ff4af59d96f93bd86c2644275f5b99ce2c36d78354e95fed34d6'
AND (
token = 'ksrB+sJGSAR/vpYYnAXYc5JKvsr+9nIMFu0kwl30gbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)