UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y06tYs1LLiizuUF8gMfnryogKwpbHTxBog5CZmKeXgk='
WHERE
key_id = '7d60742b8e34902d531e1540a5bd8277e10e1cfaa1e295029b5c4bd524450273'
AND (
token = 'y06tYs1LLiizuUF8gMfnryogKwpbHTxBog5CZmKeXgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)