UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8L1NkTi/q/blb5I1dWP7Ne48z+1IyGRgOwWhMBmzsXM='
WHERE
key_id = 'd3e6bf108ed8ac281bf4b49cddfb94e03c28479b8aa37a26e639021dfd4f3652'
AND (
token = '8L1NkTi/q/blb5I1dWP7Ne48z+1IyGRgOwWhMBmzsXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)