UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3+olVj7DG0z8g/rFFvrOm/pJzEUp4cB3Tsj14hxavrI='
WHERE
key_id = '79d1b34904efb82b9be27e7a60abd54d63c37862f28fad4302c620b5f5ca00db'
AND (
token = '3+olVj7DG0z8g/rFFvrOm/pJzEUp4cB3Tsj14hxavrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)