UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mTwW1AYEX1UbivLbpe7F/yYt+CYwmlB/mD5qoo9I/mQ='
WHERE
key_id = 'ddb81028972677c717f7b66167b6d107ff5f8d3c4cf50ce4936b56404ca559c7'
AND (
token = 'mTwW1AYEX1UbivLbpe7F/yYt+CYwmlB/mD5qoo9I/mQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)