UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QGI+FFYG4/+VD6gZmNbxh+ajNWUOepYxBaNnstws21U='
WHERE
key_id = '2095f5b346b6fdf1df9afae8efeca0af76ada07d79b4b056e72b8f6a67e60a03'
AND (
token = 'QGI+FFYG4/+VD6gZmNbxh+ajNWUOepYxBaNnstws21U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)