UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ukiN+T6aY9hlcyaV2Is4BAzrWGFqIf+qnjJYR5hm1Q='
WHERE
key_id = '428d3072e6eb444862712ea96901ea8fa6ffe25ca34c385d88f3e8e42395b386'
AND (
token = '4ukiN+T6aY9hlcyaV2Is4BAzrWGFqIf+qnjJYR5hm1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)