UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6cVXuvXrtYiu7ai+t6jbfSRvbunHa9p7iz/j9oXok9I='
WHERE
key_id = '949020d5c70f5f264dc404d9f381b413599bfc5e4056333241baecc3beef56e8'
AND (
token = '6cVXuvXrtYiu7ai+t6jbfSRvbunHa9p7iz/j9oXok9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)