UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uHSkl2m9pHYNsTy43WCTTOOKNTwqzdHjydlRJ8nyYH0='
WHERE
key_id = '45766fe18214bfb80ba9d78e1d8b05c16cb526acf0cd2520390c0c45dd542a39'
AND (
token = 'uHSkl2m9pHYNsTy43WCTTOOKNTwqzdHjydlRJ8nyYH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)