UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DvjqtLqzNpalmJndDinDzPsSkDtnR2a3XbWQl8HyZZk='
WHERE
key_id = '9d454a2bfe7825fb4cc6baa10ccbab8e4978b4a9d66f2f4ea20bc6db21ef2dee'
AND (
token = 'DvjqtLqzNpalmJndDinDzPsSkDtnR2a3XbWQl8HyZZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)