UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVur1IKRvy3ridfGr9kNPtn1xr7lli+5U0V0y2bhd2U='
WHERE
key_id = 'c527fafba95da236e28e6c9a585aee47d4650101bf1f1ede0f1eb4688549b1fb'
AND (
token = 'rVur1IKRvy3ridfGr9kNPtn1xr7lli+5U0V0y2bhd2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)