UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WDCiJH5G65ChwkMgl9L+whCGL3B7WJnI1khZPBJqej0='
WHERE
key_id = '1f1cf946786692fcdafb7d7bac773c8f63008b817bb9decf3f72794239168a95'
AND (
token = 'WDCiJH5G65ChwkMgl9L+whCGL3B7WJnI1khZPBJqej0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)