UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MVkXDKOCd7bS/GfhifBQukXaI2Z8P1J9psQcQykL1c='
WHERE
key_id = 'fe74863f1aed56017fbb6267ff2757ff8c46065a6d04f6aa8e706786d957bb77'
AND (
token = '7MVkXDKOCd7bS/GfhifBQukXaI2Z8P1J9psQcQykL1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)