UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7+oWEH0YQ9Z0ErqbvD6i32tdTSallRlaWXOP/WDmDIU='
WHERE
key_id = 'f79a3edc275832c1e839dac00a9901ca83601d0ae6ac6799fbeafd980b461ffb'
AND (
token = '7+oWEH0YQ9Z0ErqbvD6i32tdTSallRlaWXOP/WDmDIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)