UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8jwUJcUQCFLevAYH0Ag//syMl/ZNy5NATwbuhxmMACc='
WHERE
key_id = '44ec77b9c1715d34f7b69df0ff3f086bfcd7ec551ce79d0af815edf8e96e3c74'
AND (
token = '8jwUJcUQCFLevAYH0Ag//syMl/ZNy5NATwbuhxmMACc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)