UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nZbTg+TpGLp+k6QsyU8yxs8DcjhtWiBrVTP8HBQ52ro='
WHERE
key_id = '79b1b330478196895e67f847fcbffc8f36cc4fc9be9fd249877a7249a1cda22a'
AND (
token = 'nZbTg+TpGLp+k6QsyU8yxs8DcjhtWiBrVTP8HBQ52ro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)