UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zZyXI0SxGBnFpmBAITeoue45zyEjxhDkLIj/YXYWgg0='
WHERE
key_id = '9e8886b8996a617c30bc9e3d5c93f3578c8e798ab9ac7335935287d59f868010'
AND (
token = 'zZyXI0SxGBnFpmBAITeoue45zyEjxhDkLIj/YXYWgg0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)