UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iSVAC1ubIKrsWlxTCI5D4XKXnHcQ6bnMj/R1IJlDoR4='
WHERE
key_id = 'f1d24dd8e4b51a2baa0686580e751cb027976c7aa0395fe56f5eba674a894356'
AND (
token = 'iSVAC1ubIKrsWlxTCI5D4XKXnHcQ6bnMj/R1IJlDoR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)