UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kM80zn71rAdUxAT5Qykk7z0bh5t7e2Xy1/AIMT4sstM='
WHERE
key_id = '273026e9bd9165b05c90369f0c96d0f7ca85a5f4f883b5dda739d9c059b851d8'
AND (
token = 'kM80zn71rAdUxAT5Qykk7z0bh5t7e2Xy1/AIMT4sstM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)