UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h8KzAkGDc6Tu+NwKSVckcxbhgwpTfR1PurZdINMpwI4='
WHERE
key_id = '835b8a9eabc9d0c38137128eccdf6ce611cecb63e776ee982cd84db9f41fca02'
AND (
token = 'h8KzAkGDc6Tu+NwKSVckcxbhgwpTfR1PurZdINMpwI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)