UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CLuG8t5yvK4ga3XtfrF7WLU1l0wbjYy8YGpBg6TL2Xc='
WHERE
key_id = 'cd9516a94275036ff4a2e08e7a9e8cc3938f8ae327b5a280bd01f4831125b828'
AND (
token = 'CLuG8t5yvK4ga3XtfrF7WLU1l0wbjYy8YGpBg6TL2Xc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)