UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R/Bl8uzkmbVrer20Ub32P+EYb+jQhgvgii5VJHaVXMo='
WHERE
key_id = '98149680570d4f87c9ebaa6df875bad11bef9abe1d0530d5bf38bd33c223ce0a'
AND (
token = 'R/Bl8uzkmbVrer20Ub32P+EYb+jQhgvgii5VJHaVXMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)