UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '48XuUcAKxZfLxXaEDNDpe/H62+n9Zdkk+6SnIj+CtUw='
WHERE
key_id = 'd7ab7bb00406044f50977205801c4bcae192c9ea0f55bc14ed99b562e8eb5e78'
AND (
token = '48XuUcAKxZfLxXaEDNDpe/H62+n9Zdkk+6SnIj+CtUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)