UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '718DDq4G2Tmetkg317DLWqwgSQDkTpcMdB71y3xDDA0='
WHERE
key_id = '4883a4e846201cb88748584d41314fc80ba8aaf072baf0fd39e95cf7fd3d830f'
AND (
token = '718DDq4G2Tmetkg317DLWqwgSQDkTpcMdB71y3xDDA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)