UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y12akVk+R4VNXxmV3/KsDJbrJ2T0jUpTmabmVsdiyMM='
WHERE
key_id = '807081b7e94b4d12b894027275f5c07fd7ff9a8480511ba94d264071747495c6'
AND (
token = 'y12akVk+R4VNXxmV3/KsDJbrJ2T0jUpTmabmVsdiyMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)