UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ovzmIABRyT9oFhAmiJ20Oe57nE9JYh9A2/k8871VMHo='
WHERE
key_id = '98a66d79c86d1807861ff23bd89fe3b4856e07dde0d8bd018680bdb7e9b4d582'
AND (
token = 'ovzmIABRyT9oFhAmiJ20Oe57nE9JYh9A2/k8871VMHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)