UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xh7M3zXhQPX6zr1BQBVu56UiprbYxcbsCiqgMHh/Rk4='
WHERE
key_id = '4253b16f5b44f5908cfaaef6dc5c2dc23b8f180984baef494060c4b2196567fe'
AND (
token = 'xh7M3zXhQPX6zr1BQBVu56UiprbYxcbsCiqgMHh/Rk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)