UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D8IS8ktLYzh4e5sf0Z3QK6hUYUBoNGDEuVtpeW/RpB4='
WHERE
key_id = 'c97cbfda56fa4cf2d8433d3ed8127c4fe2638be606b31c2c2bc1a946d3a10314'
AND (
token = 'D8IS8ktLYzh4e5sf0Z3QK6hUYUBoNGDEuVtpeW/RpB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)