UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HYQaLI+lKPSTp8ci0qULOyL0ggMb9H/ocpOKCRgJfM='
WHERE
key_id = '4b375894ef2cda1eb156078a4f79385f5ba0461c831a0ebfd4649da31e1823e0'
AND (
token = '6HYQaLI+lKPSTp8ci0qULOyL0ggMb9H/ocpOKCRgJfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)