UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PascY9puoKAzgG/iiAYueayLbUjkFsTzZ6Hl595nH9w='
WHERE
key_id = '2ed4f7cd0c34f8b9a0555d8333b24635efa7b42ead001b3038ce7e4393a39d70'
AND (
token = 'PascY9puoKAzgG/iiAYueayLbUjkFsTzZ6Hl595nH9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)