UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dJ1xzqVpkSaCPDN/isBIphALQBlWWHdemrFn8Yrg3xo='
WHERE
key_id = '445c862a4df1a3151489395509782c5078091a80c973b78ce87e82ef7a4f4da5'
AND (
token = 'dJ1xzqVpkSaCPDN/isBIphALQBlWWHdemrFn8Yrg3xo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)