UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '01l+p19XrXfaOGgcotKlnPDk+cFHwImPw+NKVogmnqA='
WHERE
key_id = '9972dd71b65f63095a834ca0f4685668ae51aa20d9f75f850722b0c99acd25ad'
AND (
token = '01l+p19XrXfaOGgcotKlnPDk+cFHwImPw+NKVogmnqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)