UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YpJ6uFk3q/OLyZ7PXPJSDR5nu+xI9mbGjjnvAZ/zhhY='
WHERE
key_id = 'c8ce588a0b6c56d85d59a91024f89fdc81ae1cd751edaeb44817bf9985986bb3'
AND (
token = 'YpJ6uFk3q/OLyZ7PXPJSDR5nu+xI9mbGjjnvAZ/zhhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)