UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DTnnQ7VLGetKSt30hC9eGf04ciCXXYW9nxTnKMo3Hqw='
WHERE
key_id = 'ea37f46bb6f0a1ddad82e7fccd1e41258c5dbe0c5b98ebb4910e0b7fdf00113c'
AND (
token = 'DTnnQ7VLGetKSt30hC9eGf04ciCXXYW9nxTnKMo3Hqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)